const sleep = async ms => {
  return new Promise(reslove => {
    setTimeout(() => {
      reslove(true);
    }, ms);
  });
};

export default {
  async login(ctx) {
    ctx.body = {
      username: ctx.request.body.username
    };
  },
  async profile(ctx) {
    ctx.response.set({
      "Access-Control-Allow-Origin": "*"
    });
    const content = ctx.request;
    // let a = await sleep(2000);
    ctx.body = {
      status: 200,
      msg: "ok",
      data: content
    };
  }
};
